﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Manage/TeacherMasterPage.master" ValidateRequest="false" AutoEventWireup="true" CodeFile="addQuestionCourse.aspx.cs" Inherits="Manage_addQuestionCourse" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <script src="../ckeditor/ckeditor.js" type="text/javascript"></script>
<script src="../ckfinder/ckfinder.js" type="text/javascript"></script>
<script>
    function showXuanxiang(obj) {
        var s = obj.value;
        if (s == "1" || s == "2" || s == "3") {
            $("#divSelc").show()
        } else {
            $("#divSelc").hide()
        }
    }
    function chkData() {
        var QType = $("#<%=QType.ClientID %>").val();
        if (QType=="0") {
            alert("<%= Resources.labels.PleaseChkQType%>"); return false;
        }
        var QDifficulty = $("#<%=QDifficulty.ClientID %>").val();
        if (QDifficulty == "0") {
            alert("<%= Resources.labels.PleaseChkDiff%>"); return false;
        }
        var QKnowledge = $("#<%=QKnowledge.ClientID %>").val();
        if (QKnowledge == "0") {
            alert("<%= Resources.labels.PleaseChkKnowledge%>"); return false;
        }
        if (QType == "1" || QType == "2" || QType == "3") {

            var QOptions = $("#<%=QOptions.ClientID %>").val();
            if (QOptions == "") {
                alert("<%= Resources.labels.PleaseInputOpts%>"); return false;
            }
        }
        var QAnswer = $("#<%=QAnswer.ClientID %>").val();
        if (QAnswer == "") {
            alert("<%= Resources.labels.PleaseAnswer%>"); return false;
        }
        
        //return false;
    }
</script>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

<table class="grid"  border="0" cellspacing="0" cellpadding="0" width="100%">
    <thead>
        <tr>
            <th><div style="float:left; width:80%;"><%= Resources.labels.Course%><asp:Label ID="cname" runat="server" Text=""></asp:Label> <%= Resources.labels.AddQuestion%></div>
            <div style="text-align:right;margin-right:20px;">
            <a href="Course.aspx?id=<%=cid %>"><%= Resources.labels.back%></a>
            </div></th>
        </tr>
    </thead>
    <tr>
        <td align=left>
            <%= Resources.labels.select%>:
            <asp:DropDownList ID="QType" runat="server" ></asp:DropDownList>
            <asp:DropDownList ID="QDifficulty" runat="server"></asp:DropDownList>
            <asp:DropDownList ID="QKnowledge" runat="server"></asp:DropDownList>
        </td>
    </tr>
    <tr>
        <td>
            <table id="dg" class="grid" cellspacing="0" cellpadding="0" width="100%">
                <tbody>
                    <tr>
                        <td><%= Resources.labels.questiontitle%> <br />
                            <asp:TextBox ID="Qcontent" runat="server" Height="140px" TextMode="MultiLine"  Width="100%"></asp:TextBox>
                                <script type="text/javascript">
                                    if (typeof CKEDITOR == 'undefined') {  document.write('加载CKEditor失败'); }
                                    else {
                                        var editor = CKEDITOR.replace('<%=Qcontent.ClientID %>');
                                        CKFinder.SetupCKEditor(editor, '../ckfinder/'); 
                                        }
                                </script>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <div id="divSelc" style="display:none;"><%= Resources.labels.PleaseInputOpts%>：<asp:TextBox ID="QOptions" runat="server" Height="140px" TextMode="MultiLine" 
                                Width="100%"></asp:TextBox></div>
                        </td>
                    </tr>

                    <tr>
                        <td><%= Resources.labels.rightAnswer%>:<asp:TextBox ID="QAnswer" runat="server" Height="60px" TextMode="MultiLine" 
                                Width="100%"></asp:TextBox></td>
                    </tr>
                </tbody>
        
    	        <tfoot>
    	            <tr>
    	                <td>
                            <asp:Button ID="Button1" runat="server" Text="增加" CssClass="button" onClientClick="return chkData()" onclick="Button1_Click" />
    	                    <asp:Button ID="Button2" runat="server" CssClass="button" Text="返回" 
                            onclick="Button2_Click"  />
                        </td>
                    </tr>
    	        </tfoot>
            </table>
        </td>
    </tr>
</table>

</asp:Content>

